# coding: utf-8
"""
@Time    : 2020/7/6 0:01
@Author  : VillageTony
@FileName: bug_adv.py
@Software: PyCharm
@Blog    ：https://www.diaoyc.cn/
"""
from odoo import fields, models, api


class BugAdvanced(models.Model):
    _inherit = 'bm.bug'

    need_time = fields.Integer('所需时间(小时)')
    name = fields.Char(help='简要描述发现的bug')
    stages_id = fields.Many2one('bm.bug.stage',  string='阶段')
    tag_ids = fields.Many2many('bm.bug.tag', string='标示')

    @api.onchange('user_id')
    def uer_follower_ref(self):
        if not self.user_id:
            self.follower_id = None
        return {
            'warning': {
                'title': '无负责人',
                'message': '关注者也被清空'
            }
        }
